﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegCompany.aspx.cs" Inherits="jnxc.Web.RegCompany" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>林业有害生物防治信息管理平台</title>
    <meta name="description" content="林业有害生物防治信息管理平台">
    <link href="CSS/public.css" rel="stylesheet" />
    <link href="CSS/register.css" rel="stylesheet" />
    <link href="CSS/reset.css" rel="stylesheet" />
    <script src="js/jquery-1.4.4.min.js"></script>
    <script src="js/jquery.form.js"></script>
    <script src="js/json.parse.js"></script>
<script type="text/javascript">
    $(function () {
        $(".btn").click(function () {
            var agreenMent = $("#agreement").attr("data");

            //alert(agreenMent);0
            var userName = $("#username").val();
            var userPass = $("#password1").val();
            var gongshimingcheng = $("#gongshimingcheng").val();
            var yingyezhizhao = $("#yingyezhizhao").val();
            var zhuzhijigoudaimazheng = $("#zhuzhijigoudaimazheng").val();
            var shuiwudengjizheng = $("#shuiwudengjizheng").val();
            var dizhi = $("#dizhi").val();
            var dianhua = $("#dianhua").val();
            var lianxiren = $("#lianxiren").val();
            var userPass2 = $("#password2").val();
            var userEmail = $("#mail").val();
            var vercode = $("#varcode").val();

            userPass = $.trim(userPass);
            userPass2 = $.trim(userPass2);

            $(".input_div1 span,.input_div2 span,.input_div0 span,.input_div3 span,.input_div4 span,.input_div6 span,.input_div7 span,.input_div8 span,.input_div9 span,.input_div10 span,.input_div11 span,.input_div12 span,.input_div5 span").html("");
            $(".btn").val('注册中...').attr('disabled', 'disabled');

            if (!isRegisterUserName(userName)) {
                $(".input_div1 span").html('<img src="images/text_error.png"><font color=red>用户名格式不正确!</font>');
                $("#username").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            } else if (userPass.length < 8) {
                $(".input_div3 span").html('<img src="images/text_error.png"><font color=red>密码格式不正确!</font>');
                $("#password1").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (gongshimingcheng.length == '') {
                $(".input_div0 span").html('<img src="images/text_error.png"><font color=red>公司名称不能为空!</font>');
                $("#gongshimingcheng").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (yingyezhizhao.length == '') {
                $(".input_div7 span").html('<img src="images/text_error.png"><font color=red>营业执不能为空!</font>');
                $("#yingyezhizhao").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (zhuzhijigoudaimazheng.length == '') {
                $(".input_div8 span").html('<img src="images/text_error.png"><font color=red>组织机构代码证不能为空!</font>');
                $("#zhuzhijigoudaimazheng").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (shuiwudengjizheng.length == '') {
                $(".input_div9 span").html('<img src="images/text_error.png"><font color=red>税务登记码证不能为空!</font>');
                $("#shuiwudengjizheng").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (dizhi.length == '') {
                $(".input_div10 span").html('<img src="images/text_error.png"><font color=red>地址不能为空!</font>');
                $("#dizhi").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (dianhua.length == '') {
                $(".input_div11 span").html('<img src="images/text_error.png"><font color=red>电话不能为空!</font>');
                $("#dianhua").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
            else if (lianxiren.length == '') {
                $(".input_div12 span").html('<img src="images/text_error.png"><font color=red>联系不能为空!</font>');
                $("#lianxiren").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }

            else if (!isEmail(userEmail)) {
                $(".input_div2 span").html('<img src="images/text_error.png"><font color=red>邮箱格式不正确!</font>');
                $("#mail").focus();
                $(".btn").val('注册').removeAttr('disabled');
                return false;
            }
        })

    });

    function isRegisterUserName(s) {
        var patrn = /^[a-zA-Z0-9]{1}([a-zA-Z0-9]|[._]){5,19}$/;
        if (!patrn.exec(s)) return false
        return true
    }

    function isEmail(email) {
        var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
        if (!myreg.test(email)) return false;
        return true;
    }

</script>

    <style>
.input_div span{ background:#FFF;}
</style>
</head>
<body>

    <form id="form1" runat="server">
        <div id="header">
            <div class="header">
                <img src="images/login.jpg" width="493" height="90">
                <a class="png_bg" href="index.aspx">返回主页</a>
            </div>
        </div>

        <div class="register_content">

            <ul class="step_ul step1 clear">
                <li class="li1">01、填写资料</li>
                <li class="li2">02、完成注册</li>
            </ul>
            <div class="div_form clear ">
                <label>公司名称：</label>
                <div class="input_div input_div0">
                    
                                    <asp:TextBox ID="txtfname" runat="server" Width="200px" CssClass="myinput"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtfname">不能为空</asp:RequiredFieldValidator>
                                <span></span>
                </div>
            </div>
            <div class="div_form clear ">
                <label>营业执照：</label>
                <div class="input_div input_div7">
                    <asp:FileUpload ID="fyz" runat="server" CssClass="myinput" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="fyz">不能为空</asp:RequiredFieldValidator>
                                
                </div>
            </div>
            <div class="div_form clear ">
                <label>组织机构代码证：</label>
                                    <asp:FileUpload ID="fzj" runat="server" CssClass="myinput" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="fzj">不能为空</asp:RequiredFieldValidator>
            </div>
            <div class="div_form clear ">
                <label>
                税务登记证： </label>
                   <div class="input_div input_div9">
                                    <asp:FileUpload ID="fsd" runat="server" CssClass="myinput" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="fsd">不能为空</asp:RequiredFieldValidator>
                                &nbsp;<span></span></div>
            </div>
            <div class="div_form clear ">
                <label>地址：</label>
                <div class="input_div input_div10">
                                    <asp:TextBox ID="txtfadd" runat="server" Width="200px" CssClass="myinput"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtfadd">不能为空</asp:RequiredFieldValidator>
                                &nbsp;<span></span></div>
            </div>
            <div class="div_form clear ">
                <label>电话：</label>
                <div class="input_div input_div11">
                                    <asp:TextBox ID="txtftel" runat="server" Width="126px" CssClass="myinput"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtftel">不能为空</asp:RequiredFieldValidator>
                                &nbsp;<span></span></div>
            </div>
            <div class="div_form clear ">
                <label>联系人：</label>
                <div class="input_div input_div12">
                                    <asp:TextBox ID="txtflinker" runat="server" Width="83px" CssClass="myinput"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtflinker">不能为空</asp:RequiredFieldValidator>
                                &nbsp;<span></span></div>
            </div>
            <div class="div_form clear ">
                <label>邮箱：</label>
                <div class="input_div input_div2">
                                    <asp:TextBox ID="txtfemail" runat="server" Width="200px" CssClass="myinput"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtfemail" Display="Dynamic">不能为空</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="RegularExpressionValidator" ControlToValidate="txtfemail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">格式不对</asp:RegularExpressionValidator>
                                &nbsp;<span></span></div>
            </div>
            <div class="div_form clear ">
                <label>企业照片：</label>
                <div class="input_div input_div13">
                                    <asp:FileUpload ID="fpic" runat="server" CssClass="myinput" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="fpic">不能为空</asp:RequiredFieldValidator>
                                &nbsp;</div>
            </div>
            <div class="div_form clear ">
                <label>企业类型：</label>
                <div class="input_div input_div13">
                    <asp:DropDownList ID="ddltype" runat="server" CssClass="myinput" >
                        <asp:ListItem Selected="True">物理防治</asp:ListItem>
                        <asp:ListItem>生物防治</asp:ListItem>
                        <asp:ListItem>化学防治</asp:ListItem>
                    </asp:DropDownList>           
                </div>
            </div>
             <div class="div_form clear " style="height:auto;">
                 <div style="width: 150px; text-align: right;">简介：</div>
                 <div style="padding: 5px;">

                                        <CKEditor:CKEditorControl ID="ckcontent" runat="server">
                                        </CKEditor:CKEditorControl>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="ckcontent">不能为空</asp:RequiredFieldValidator>
                                    </div>
            </div>
            <div class="div_form clear ">
                <label>验证码：</label>
                <div class="input_div input_div13">
                  <asp:TextBox ID="txtcode" runat="server" Width="200px" CssClass="myinput"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtcode" Display="Dynamic">不能为空</asp:RequiredFieldValidator>            
                    <img alt="" src="ashx/ValidateCode.ashx" /></div>
            </div>
            <div class="div_form clear ">
                <label></label>
                <div class="input_div">
                    <asp:Button ID="btnSave" runat="server" Text="提交" class="mybtn"
                            OnClick="btnSave_Click" ></asp:Button>
                        &nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnCancle" runat="server" Text="取消" class="mybtn"
                    OnClick="btnCancle_Click" ></asp:Button>                    
                </div>
            </div>

            <div class="bg"></div>
        </div>
       
    </form>
</body>
</html>
